import argparse

def parse_arguments(rosemary):
    parser = argparse.ArgumentParser(description="RoseMary: Media server.",
            formatter_class=argparse.ArgumentDefaultsHelpFormatter)

    parser.add_argument("-pi",  "--plugin",          help="install plugin by name"                                )
    parser.add_argument("-pu",   "--plugun",        help="uninstall plugin by name"                    )  
    args = parser.parse_args()

    if args.plugin != None: rosemary.plugman.load_from_repo_by_name(args.plugin); exit(0)
    elif args.plugun != None: rosemary.plugman.remove_plugin(args.plugun); exit(0)

